package com.zhpj.controller;

import com.zhpj.util.IniUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("ini")
@CrossOrigin
public class IniController {
    @Autowired
    private IniUtil iniUtil;

    @CrossOrigin
    @RequestMapping("setIni")
    private void setIni(String username){
        iniUtil.setTokenValue(username);
    }

    @RequestMapping("getIni")
    private String getIni(){
        String tokenValue = iniUtil.getTokenValue();
        return tokenValue;
    }

}
